<h1>ButtonSound</h1>

<p>ButtonSound defines the sounds that are played when an event occurs in a button. 
A sound is played for only a subset of the events that a button responds to:</p>

<table>
<tr><td>rollOver</td><td>The cursor enters the active area of the button.</td></tr> 
<tr><td>rollOut</td><td>The cursor exits the active area of the button.</td></tr> 
<tr><td>press</td><td>The mouse button is clicked and the cursor is inside the active area of the button.</td></tr> 
<tr><td>release</td><td>The mouse button is released while the cursor is inside the active area of the button.</td></tr>
</table>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the ButtonSound instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. If the length is greater 
than 62 then this field is set to 0x3F and the length is encoded using the 
extendedLength field. Encoded with the type field as a 16-bit integer.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The identifier of an DefineButton or DefineButton2 instruction that defines 
the button.</td>
</tr>

<tr>
<td nowrap valign="top"><a name="ButtonSound_4">sound[rollOver]</a></td>
<td nowrap valign="top" colspan="2">Sound</td>
<td>Describes the sound that will be played for a rollOver event. If no sound 
is played for this event the Sound is replaced by 0x0000, compressing the size
of the encoded instruction.</td>
</tr>

<tr>
<td nowrap valign="top"><a name="ButtonSound_5">sound[rollOut]</a></td>
<td nowrap valign="top" colspan="2">Sound</td>
<td>Describes the sound that will be played for a rollOut event. If no sound 
is played for this event the Sound is replaced by 0x0000, compressing the size
of the encoded instruction.</td>
</tr>

<tr>
<td nowrap valign="top"><a name="ButtonSound_6">sound[press]</a></td>
<td nowrap valign="top" colspan="2">Sound</td>
<td>Describes the sound that will be played for a press event. If no sound 
is played for this event the Sound is replaced by 0x0000, compressing the size
of the encoded instruction.</td>
</tr>

<tr>
<td nowrap valign="top"><a name="ButtonSound_7">sound[release]</a></td>
<td nowrap valign="top" colspan="2">Sound</td>
<td>Describes the sound that will be played for a release event. If no sound 
is played for this event the Sound is replaced by 0x0000, compressing the size
of the encoded instruction.</td>
</tr>

</table>

<h2>History</h2>

<p>The ButtonSound is defined as the DefineButtonSound structure in the 
Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 2.</p>
